/*
 * ImageList.java
 *
 * Created on 26 wrzesień 2007, 16:54
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package picassawad;

import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author jaszczur
 */
public class ImageList extends DefaultHandler {
    
    private List<String> urls = new ArrayList<String>();
    
    /** Creates a new instance of ImageList */
    public ImageList() {
    }
    
    
    @Override
    public void startElement(String uri,
            String localName,
            String qName,
            Attributes attributes)
            throws SAXException {
        
//        System.err.println(qName);
        
        if (qName.equals("media:content") && attributes.getValue("medium").equals("image")) {
            urls.add(attributes.getValue("url"));
        }
        
    }

    public List<String> getUrls() {
        return urls;
    }

    public void setUrls(List<String> urls) {
        this.urls = urls;
    }
    
}
